//
//  destCollectionHeaderReusableView.m
//  INAlienLand
//
//  Created by dllo on 15/6/30.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "destCollectionHeaderReusableView.h"

@implementation destCollectionHeaderReusableView
- (void)dealloc
{
    [_titlelable release];
    [_myButton release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titlelable = [[UILabel alloc]init];
        [self addSubview:self.titlelable];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.titlelable.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}
-(void)setIsAdd:(BOOL)isAdd
{
    _isAdd=isAdd;
    [self addButton];
    
}

-(void)addButton
{
    if(self.isAdd==YES){
    self.myButton=[UIButton buttonWithType:UIButtonTypeCustom];
    self.myButton.frame=CGRectMake(200, 10, 100, 45);
        [self.myButton setImage:[UIImage imageNamed:@"我的"] forState:UIControlStateNormal];
        [self addSubview:self.myButton];
    }
    else
    {
        [self.myButton removeFromSuperview];
    }
}

@end
